package com.infra.server.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: zzd
 * @Date: 2020/7/3 17:01
 * @Description: 日志实体类
 */
@Data
@TableName(value = "sys_log")
@ApiModel(value = "sys_log",description = "日志实体类")
public class SysLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "请求者id即用户id")
    private Long userId;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "请求类型")
    private String httpMethod;

    @ApiModelProperty(value = "请求者ip")
    private String requestIp;

    @ApiModelProperty(value = "请求url")
    private String requestUrl;

    @ApiModelProperty(value = "请求参数")
    private String requestParams;

    @ApiModelProperty(value = "响应状态码")
    private Integer responseCode;

    @ApiModelProperty(value = "响应信息")
    private String responseMsg;

    @ApiModelProperty(value = "执行时间")
    private Long executionTime;

    @ApiModelProperty(value = "请求时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "客户端ip")
    private String clientId;

}
